package com.tang.service.impl;

import com.tang.service.ALotteryService;
import com.tang.service.MiniBusTargetService;
import com.tang.vo.LotteryResult;

import java.time.LocalDateTime;

public class LotteryServiceImpl extends ALotteryService {

    private final MiniBusTargetService miniBusTargetService;

    public LotteryServiceImpl() {
        this.miniBusTargetService = new MiniBusTargetService();
    }

    @Override
    protected LotteryResult doDraw(String uId) {
        String lottery = miniBusTargetService.lottery(uId);
        return new LotteryResult(uId, lottery, LocalDateTime.now());
    }

}
